package com.leyou.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.leyou.item.dto.BrandDTO;
import com.leyou.item.entity.Brand;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface BrandMapper extends BaseMapper<Brand> {
    @Select("select tb.* from tb_brand tb\n" +
            "left join tb_category_brand tcb on tb.id = tcb.brand_id\n" +
            "where tcb.category_id = #{id}")
    List<BrandDTO> queryBrandByCategoryId(@Param("id") Long id);
}
